/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.geotools.geosearch;

import com.vividsolutions.jts.geom.Point;
import org.geotools.geometry.DirectPosition2D;
import org.opengis.feature.simple.SimpleFeature;

/**
 *
 * @author oleg
 */
public class RoutePoint {
    SimpleFeature feature;

    String name;
    String id;

    public RoutePoint(SimpleFeature feature) {
        this.feature = feature;
        id=feature.getID();
        name=feature.getProperty("name").getValue().toString();
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getId() {
        return id;
    }

    public SimpleFeature getFeature() {
        return feature;
    }

    public DirectPosition2D getCoordinate(){
        Point point = (Point) feature.getDefaultGeometry();
        DirectPosition2D d=new DirectPosition2D(point.getX(), point.getY());
        return d;

    }

    
}
